<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>test sWin</title>

        <SCRIPT type="text/javascript">
            function inittitle(odiv,title)
            {
                title.onmousedown = function(e) 
                {
                    if (e==null) e=window.event;
                    var x=e.layerX?e.layerX:e.offsetX;
                    var y=e.layerY?e.layerY:e.offsetY;

                    if(title.setCapture) 
                    {  // for ie brower
                        title.setCapture();
                        document.onmousemove = function (e) 
                        {
                            if (e==null)  e=window.event;
                            if (!e.pageX) e.pageX=e.clientX;
                            if (!e.pageY) e.pageY=e.clientY;
                            var tx=e.pageX-x;
                            var ty=e.pageY-y;

                            odiv.style.left = tx + "px";
                            odiv.style.top = ty + "px";
                        };
                        document.onmouseup=function()
                        {
                            title.releaseCapture();
                            document.onmousemove = null;
                            document.onmouseup = null;
                        };
                    } 
                    else if(document.addEventListener)
                    {
                        function mousemove(e) 
                        {
                            if (e==null)  e = window.event;
                            if (!e.pageX) e.pageX=e.clientX;
                            if (!e.pageY) e.pageY=e.clientY;
                            var tx=e.pageX-x;
                            var ty=e.pageY-y;

                            odiv.style.left=tx + "px";
                            odiv.style.top=ty + "px";
                        };
                        function mouseup(e) 
                        {
                            document.removeEventListener("mousemove",mousemove, false);
                            document.removeEventListener("mouseup",mouseup,false);
                        };

                        document.addEventListener("mousemove",mousemove, false);
                        document.addEventListener("mouseup", mouseup, false);
                    }
                };
            }

            function initclose(odiv,close)
            {
                close.onmouseout=function(e)
                {
                    var css = "text-decoration:none; font-size:13px; "
                        + "font-weight:bold; color:#ffffff";                    
                    close.style.cssText = css;        
                };
                close.onmouseover=function(e)
                {
                    var css = "text-decoration:none; font-size:13px; "
                        + "font-weight:bold; background-color:#FFD0F0";
                    close.style.cssText = css;        
                };
                close.onmousedown=function(e)
                {
                    ;
                }
                close.onclick=function(e)
                {
                    odiv.style.display="none";
                }
            }
            function closeswin(){}
            function donothing(){}

            function sub_window()
            {
                var csst= "position:absolute; " 
                    + "border:2px solid #EAEAEA; "
                    + "left:10px; top:10px; "
                    + "width:522px; height:380px; ";
                var css1= "height:15px; "
                    + "background-color:#0D0D0D; ";
                var css2 = "height:362px; background-color:#FFFFFF; ";

                var d1 = document.createElement("div");
                var d2 = document.createElement("div");
                var odiv = document.createElement("div");

                odiv.appendChild(d1);
                odiv.appendChild(d2);
                document.body.appendChild(odiv);

                odiv.style.cssText = csst;
                d1.style.cssText = css1;
                d2.style.cssText = css2;

                d1.innerHTML="<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">"
                    +"<tr><td style=\"color:#ffffff; font-size:13px; font-weight:bold;"
                    +"padding-left:2px; width:500px; cursor:default;\" "
                    +"id=\"sWin_title\" valign=\"top\">Test Test</td>"
                    +"<td align=\"center\" onmousedown=\"javascript:donothing();\">"
                    +"<a href=\"javascript:closeswin();\" id=\"sWin_close\" "
                    +"style=\"text-decoration:none; font-size:13px; "
                    +"font-weight:bold; color:#ffffff\">X</td></tr></table>";

                var title = document.getElementById ("sWin_title");
                var close = document.getElementById ("sWin_close");

                inittitle(odiv,title);
                initclose(odiv,close);

                this.client = d2;
            }
            //var sub;
            //window.onload = function() { sub = sub_window();}
        </SCRIPT>
        <STYLE>
            #main_frame
            {
        		border:3px #ededed solid;
                background-color:#DEDEDE;
				height:100%;
				width:100%;
            }
        </STYLE>
    </head>
    <body>
        <iframe id = "main_frame" src="http://www.google.com" frameborder="3"></iframe>
    </body>
</HTML>

